from django.core.management.base import BaseCommand
from django.core.management import call_command


class Command(BaseCommand):
    help = 'Load fixtures in a specific order'

    def handle(self, *args, **kwargs):
        fixtures = [
            'initial_procedure_fixture.json',
            # 'initial_months_fixture.json',
        ]

        for fixture in fixtures:
            self.stdout.write(f'Loading fixture {fixture}')
            call_command('loaddata', fixture)
            self.stdout.write(self.style.SUCCESS(f'Successfully loaded {fixture}'))
